package algorithm_optimal_solution.LinkedList;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

//按照左右半区的方式组合链表：找到中间节点（长度为奇数则为中间值。偶数则为中间前一个数）。left从头遍历，right从中间下一个节点遍历，对两个进行组合。
// 遍历结束将right剩余节点添加到left尾部。
public class LeftRightHalfAreaRelocateLinkedList {

    static class Node{
        private int value;
        private Node node;

        public Node(int value,Node node){
            this.value = value;
            this.node = node;
        }

        public int getValue() {
            return value;
        }

        public void setValue(int value) {
            this.value = value;
        }

        public Node getNode() {
            return node;
        }

        public void setNode(Node node){
            this.node = node;
        }
    }

    public void relocateLinkedList(Node head){
        Node mid = head;
        Node right = head.getNode();
        while(right.getNode() != null && right.getNode().getNode() != null){
            mid = mid.getNode();
            right = right.getNode().getNode();
        }
        right = mid.getNode();
        mid.setNode(null);
        Node cur = head;
        Node next = null;
        while(cur.getNode() != null){
            next = right.getNode();
            right.setNode(cur.getNode());
            cur.setNode(right);
            cur = right.getNode();
            right = next;
        }
        cur.setNode(right);
        StringBuilder sb = new StringBuilder();
        while(head != null){
            sb.append(head.getValue()).append(" ");
            head = head.getNode();
        }
        System.out.print(sb);
    }

    public static void main(String[] args)throws IOException {
        BufferedReader scanner = new BufferedReader(new InputStreamReader(System.in));
        int len = Integer.parseInt(scanner.readLine());
        String[] numbers = scanner.readLine().split(" ");
        Node node = null;
        for(int i = len - 1;i >= 0;i--){
            node = new Node(Integer.parseInt(numbers[i]),node);
        }
        new LeftRightHalfAreaRelocateLinkedList().relocateLinkedList(node);
    }
}
